package controller.session.login;

import java.io.Serializable;

import br.com.caelum.vraptor.ioc.Component;
import br.com.caelum.vraptor.ioc.SessionScoped;
import dao.entity.Usuario;

@Component
@SessionScoped
public class UserSession implements Serializable {

	private static final long serialVersionUID = 2023029491651479715L;
	
	private Usuario user;

	public boolean isLogged() {
		return getUser() != null;
	}

	public void logout() {
		setUser(null);
	}

	public Usuario getUser() {
		return user;
	}

	public void setUser(Usuario user) {
		this.user = user;
	}
}
